package com.zyd.blog.personal.utils;

import com.zyd.blog.personal.vo.ResponseResultVo;

/**
 * 返回结果快速得到工具类
 * @author mfy
 */
public class RespResultUtils {

    public static ResponseResultVo getSuccessBoolean(String msg){
        ResponseResultVo responseResultVo = new ResponseResultVo();
        responseResultVo.setSuccess(true);
        responseResultVo.setMsg(msg);
        return responseResultVo;
    }

    public static ResponseResultVo getFailResult(String msg){
        ResponseResultVo responseResultVo = new ResponseResultVo();
        responseResultVo.setSuccess(false);
        responseResultVo.setCode(1);
        responseResultVo.setSpecCode(500);
        responseResultVo.setMsg(msg);
        return responseResultVo;
    }

    public static ResponseResultVo getSuccessData(Object data){
        ResponseResultVo responseResultVo = new ResponseResultVo();
        responseResultVo.setSuccess(true);
        responseResultVo.setData(data);
        return responseResultVo;
    }
}
